/*     */ package change.org.eclipse.swt.browser.mozilla.core;
/*     */ 
/*     */ import java.io.File;
/*     */ import java.io.FileNotFoundException;
/*     */ import org.mozilla.xpcom.IAppFileLocProvider;
/*     */ 
/*     */ public class AppFileLocProvider
/*     */   implements IAppFileLocProvider
/*     */ {
/*     */   private File libxul;
/*     */   private static final String PLUGINS_DIRECTORY = "plugins";
/*     */   private static final String HISTORY_FILE = "history.dat";
/*     */   private static final String COMPREG_FILE = "compreg.dat";
/*     */   private static final String XPTI_FILE = "xpti.dat";
/*     */   private static final String COMPONENTS_DIRECTORY = "components";
/*     */   private static final String CHROME_DIRECTORY = "chrome";
/*     */ 
/*     */   public AppFileLocProvider(File xulRunnerPath)
/*     */     throws FileNotFoundException
/*     */   {
/*  30 */     this.libxul = xulRunnerPath;
/*     */ 
/*  32 */     if ((xulRunnerPath == null) || (!(xulRunnerPath.exists())) || (!(xulRunnerPath.isDirectory())))
/*  33 */       throw new FileNotFoundException("libxul directory specified is not valid: " + xulRunnerPath.getAbsolutePath());
/*     */   }
/*     */ 
/*     */   public File getFile(String prop, boolean[] persistent)
/*     */   {
/*  50 */     persistent[0] = false;
/*     */ 
/*  52 */     File resultFile = null;
/*     */ 
/*  54 */     if ("ProfD".equals(prop))
/*  55 */       resultFile = this.libxul;
/*  56 */     else if ("UHist".equals(prop))
/*  57 */       resultFile = new File(this.libxul, "history.dat");
/*  58 */     else if ("ComRegF".equals(prop))
/*  59 */       resultFile = new File(this.libxul, "compreg.dat");
/*  60 */     else if ("XptiRegF".equals(prop))
/*  61 */       resultFile = new File(this.libxul, "xpti.dat");
/*  62 */     else if ("GreD".equals(prop))
/*  63 */       resultFile = this.libxul;
/*  64 */     else if (("GreComsD".equals(prop)) || ("ComsD".equals(prop))) {
/*  65 */       resultFile = new File(this.libxul, "components");
/*     */     }
/*  67 */     else if ("AChrom".equals(prop)) {
/*  68 */       resultFile = new File(this.libxul, "chrome");
/*     */     }
/*     */     else {
/*  71 */       resultFile = this.libxul;
/*     */     }
/*     */ 
/*  80 */     return resultFile;
/*     */   }
/*     */ 
/*     */   public File[] getFiles(String prop) {
/*  84 */     File[] resultFiles = (File[])null;
/*  85 */     if ("APluginsDL".equals(prop)) {
/*  86 */       resultFiles = new File[] { new File(this.libxul, "plugins") };
/*     */     }
/*     */ 
/* 100 */     return resultFiles;
/*     */   }
/*     */ }
